#include <signal.h>
#include <stdio.h>
#include <string.h>
void hdfunc(int sig);

int main()
{
	struct sigaction stact;
	memset(&stact,0,sizeof(stact));

	stact.sa_handler = hdfunc;
	sigaddset(&stact.sa_mask, 15);
	stact.sa_flags=SA_RESTART;
	sigaction(2,&stact,NULL);
	sigaction(15, &stact, NULL);
	
	char str[51]; memset(str,0,sizeof(str));
	scanf("%s", str);
	printf("str=%s\n",str);

	return 0;
	
}

void hdfunc(int sig)
{
	printf("sig=%d\n", sig);
	
	for(int jj=1; jj <= 5; jj++)
	{
		printf("jj(%d)=%d\n", sig, jj);
		sleep(1);
	}
}
